import request from '@/utils/request'

// 查询自媒体平台配置列表
export function listPlatform(query) {
  return request({
    url: '/media/mediaPlatform/list',
    method: 'get',
    params: query
  })
}

// 查询自媒体平台配置详细
export function getPlatform(id) {
  return request({
    url: '/media/mediaPlatform/' + id,
    method: 'get'
  })
}

// 新增自媒体平台配置
export function addPlatform(data) {
  return request({
    url: '/media/mediaPlatform',
    method: 'post',
    data: data
  })
}


export function updatePlatformStatus(id, status) {
  const data = {
    id,
    status
  }
  console.log(data)
  return request({
    url: '/media/mediaPlatform/updatePlatformStatus',
    method: 'put',
    data: data
  })
}

// 修改自媒体平台配置
export function updatePlatform(data) {
  return request({
    url: '/media/mediaPlatform',
    method: 'put',
    data: data
  })
}

// 删除自媒体平台配置
export function delPlatform(id) {
  return request({
    url: '/media/platform/' + id,
    method: 'delete'
  })
}
